﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace CitiSurface
{
    /**
     * Customized Style Selector used for ScatterViewItem in the main window
     */
    class CsScatterItemStyleSelector : StyleSelector
    {
        public Style ImageStyle { get; set; }

        public Style VideoStyle { get; set; }

        public Style DocStyle { get; set; }

        public override Style SelectStyle(object item, DependencyObject container)
        {
            var element = container as FrameworkElement;

            //select Style by Item type
            if(element != null)
            {
                if(item is MainBarAlbum)
                {
                    return ImageStyle;
                }
                if(item is MainBarVideo)
                {
                    return VideoStyle;
                }
                if(item is MainBarDoc)
                {
                    return DocStyle;
                }
            }
            return null;
        }

    }
}
